package com.cys.dm.rest.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.cys.dm.dao.base.DmAreaDao;
import com.cys.dm.entity.base.DmArea;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class DmAreaService {
    @Resource
    private DmAreaDao dmAreaDao;

    @PostMapping(path = "/queryCityList")
    public List<DmArea> dmAreaList(){
        QueryWrapper<DmArea> queryWrapper = new QueryWrapper<>();
        return dmAreaDao.selectList(queryWrapper);
    }

    @PostMapping(path = "/findById")
    public DmArea findById(@RequestParam("id") Integer id){
        QueryWrapper<DmArea> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("id",id);
        return dmAreaDao.selectOne(queryWrapper);
    }
}
